﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace ChapterX.Common
{
    // TODO: read settings from web.config
    public class ChapterXConfiguration
    {
        public static String ConnectionString
        {
            get { return ConfigurationManager.ConnectionStrings["ChapterXDBConnectionString"].ConnectionString; }
        }

        public static String UploadHandlerUrl = "~/Auth/Upload.ashx";

        #region 密码强度

        private static int _passwordSaltSize = 5;

        public static int PasswordSaltSize
        {
            get { return _passwordSaltSize; }
            set { _passwordSaltSize = value; }
        }

        #endregion

        #region 访问计数相关

        private static String _digitImageDir = "~/images/digits/";
        private static String _digitImageSuffix = ".jpg";
        private static int _baseCount = 1000000; // 访问计数基值

        public static String DigitImageDir
        {
            get { return _digitImageDir; }
        }

        public static String DigitImageSuffix
        {
            get { return _digitImageSuffix; }
        }

        public static int BaseCount
        {
            get { return _baseCount; }
            set { _baseCount = value; }
        }

        #endregion

        #region 文件相关目录

        public static String CourseAttachmentsDir = "~/files/course-attachments/";

        public static String BookAttachmentsDir = "~/files/book-attachments/";

        public static String BookChaptersDir = "~/files/book-chapters/";

        #endregion
    }
}

